const Koa = require('koa')
const app = new Koa()
const views = require('koa-views')
const { resolve } = require('path')
 
app.use(views(resolve(__dirname, './views'), {
    extension: 'pug'
}))
app.use(async (ctx, next) => {
    await ctx.render('index', {
        you: 'oasos',
        me: '体验啊'
    })
})




// const { htmlTpl, ejsTpl, pugTpl} = require('./tpl/index')
// const ejs = require('ejs')
// const pug = require('pug')

// app.use(async (ctx, next) => {
//     ctx.type = 'text/html, charset=utf-8'
//     ctx.body = htmlTpl
//     ctx.body = ejs.render(ejsTpl, {
//         you: 'zhzhuzh',
//         me: 'chichichi'
//     })
//     ctx.body = pug.render(pugTpl, {
//         you: 'sss',
//         me: 'vv'
//     })
// })

app.listen(8888)